<%@ page import="net.gz01.util.ZOMD5" %>
<%@ page import="net.gz01.wallet.web.controller.api.ParamUtil" %>
<%@ page import="java.util.Map" %>
<%@ page import="sun.security.provider.MD5" %>
<%@ page import="net.gz01.util.ZOHttp" %>
<%@ page import="net.gz01.util.ZOJson" %>
<%@ page import="org.apache.commons.lang3.StringUtils" %>
<%@ page import="java.util.TreeMap" %>
<%@ page import="net.gz01.wallet.web.config.SystemConfig" %><%--
  Created by IntelliJ IDEA.
  User: lanpeng
  Date: 2019-06-20
  Time: 12:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%=request.getRemoteHost()%>
<%=request.getRequestURI() %>
<%
    String AuthorizationURL = "/api/addUser";
    String username = request.getParameter("userName");
    String password = request.getParameter("passWord");
    String custerCode = request.getParameter("custerCode");
    String custerName = request.getParameter("custerName");
    String inCome = request.getParameter("inCome");
    String accountType = request.getParameter("accountType");

    String send = "";
    String res="";
    Map<String, String> map =null;
    if(StringUtils.isEmpty(username) || StringUtils.isEmpty(password) ||
    StringUtils.isEmpty(custerCode) || StringUtils.isEmpty(custerName) ||
    StringUtils.isEmpty(inCome) || StringUtils.isEmpty(accountType)){
        res = "必填数据不能为空!";
    }else {
        map = ParamUtil.getParamMap(request);
        map.put("version", "V1.0");
        map.put("timestamp", System.currentTimeMillis() + "");
        send = map.toString();
        String sign = ZOMD5.sortSign(map, SystemConfig.config.get("apiyl_key"));
        map.put("sign", sign);
        String url = "http://" + request.getRemoteHost() + ":" + "8033" + AuthorizationURL;
        res = ZOHttp.postJson(url, ZOJson.toString(map));

        System.out.println(res);
    }
%>

<p>发送数据: <%=send%></p>


<p>接受数据: <%=res%></p>

</body>
</html>
